import java.util.Scanner;

public class Frog {
    static int n;
    static int x;
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        n=scanner.nextInt();
        x=scanner.nextInt();
        int []arr1=new int[n-1];//记录每个位置河中的石头数量
        int []arr2=new int[n-1];//记录每个位置及之前的石头数量总和
        int sum=0;
        for (int i = 0; i <n-1 ; i++) {
            int temp=scanner.nextInt();
            sum+=temp;
            arr2[i]=sum;
        }
        int left=0;int right=n-1;int s=0;
        while(left<right){
            int mid=(left+right)/2;
            if(iffh(arr2,mid)){
                s=mid;
                right=mid-1;
            }
            else{
                left=mid+1;
            }
        }
        System.out.println(s);
    }
    private static boolean iffh(int []arr2,int mid){
        for (int i=0;i+mid<n;i++){
            if(arr2[i+mid]-arr2[i]<2*x){
                return false;
            }
        }
        return true;
    }
}
